<template>
	<view class="y-flex" :style="{'height': barHeight + 'px', 'background-color': color}"></view>
</template>

<script>
	export default {
		props: {
			color: {
				type: String,
				default: ''
			}
		},
		data () {
			return {
				barHeight: 0
			}
		},
		created () {
			uni.getSystemInfo({
				success: (res) => {
					// #ifndef H5
					this.barHeight = res.safeArea.top
					// #endif
					// #ifdef H5
					this.barHeight = res.windowTop
					// #endif
				}
			})
		}
	}
</script>

<style>
</style>
